import request from '@/utils/request'

// 查询检疫项目列表
export function listQuaItem(query) {
  return request({
    url: '/animalManagement/quaItem/list',
    method: 'get',
    params: query
  })
}

// 查询检疫项目详细
export function getQuaItem(quaItemId) {
  return request({
    url: '/animalManagement/quaItem/' + quaItemId,
    method: 'get'
  })
}

// 新增检疫项目
export function addQuaItem(data) {
  return request({
    url: '/animalManagement/quaItem',
    method: 'post',
    data: data
  })
}

// 修改检疫项目
export function updateQuaItem(data) {
  return request({
    url: '/animalManagement/quaItem',
    method: 'put',
    data: data
  })
}

// 删除检疫项目
export function delQuaItem(quaItemId) {
  return request({
    url: '/animalManagement/quaItem/' + quaItemId,
    method: 'delete'
  })
}

// 获取检疫类型下的检疫项目
export function getQuaItemsByType(quaType) {
  return request({
    url: '/animalManagement/quaItem/type/' + quaType,
    method: 'get'
  })
}

// 发起检疫
export function initiateQuarantine(data) {
  return request({
    url: '/animalManagement/quaRecord/initiate',
    method: 'post',
    data: data
  })
}

// 检疫录入
export function inputQuarantine(data) {
  return request({
    url: '/animalManagement/quaRecord/input',
    method: 'put',
    data: data
  })
}

// 动物淘汰
export function eliminateAnimal(animalId) {
  return request({
    url: '/animalManagement/animal/eliminate/' + animalId,
    method: 'put'
  })
}

// 分配笼位
export function assignCage(data) {
  return request({
    url: '/animalManagement/quaRecord/assignCage',
    method: 'put',
    data: data
  })
}

// 获取检疫记录列表
export function listQuaRecord(query) {
  return request({
    url: '/animalManagement/quaRecord/list',
    method: 'get',
    params: query
  })
}

// 获取检疫记录详细
export function getQuaRecord(quaRecordId) {
  return request({
    url: '/animalManagement/quaRecord/' + quaRecordId,
    method: 'get'
  })
}

// 获取检疫记录明细列表
export function listQuaRecordItem(query) {
  return request({
    url: '/animalManagement/quaRecord/item/list',
    method: 'get',
    params: query
  })
}